import React, { Component } from 'react'
import Header from '../../components/Header'
import Search from '../../components/Search';
import {UnorderedListOutline} from 'antd-mobile-icons'
import { reqGetgoods } from '../../http/api';
import GoodsCar from '../../components/GoodsCar';
import './list.less'

export default class List extends Component {
  constructor(){
    super();
    this.state={
      listGoodsArr:[]
    }
  }
  componentDidMount(){
    reqGetgoods().then(res=>{
      if(res.data.code===200){
        this.setState({
          listGoodsArr:res.data.list
        })
      }
    })
  }
  render() {
    return (
      <div className='List'>
          <Header title="小U优选" back></Header>
          <Search></Search>
          <div className="goodslist">
            <div className="head">
              <span>综合推荐</span><span>销量</span><span>价格</span><span>好评度</span><span>店铺</span><span><UnorderedListOutline style={{'fontSize':'.3rem'}}/>分类</span>
            </div>
            <GoodsCar goodsArr={this.state.listGoodsArr}></GoodsCar>
          </div>
      </div>
    )
  }
}
